Repository navigation
Lowering fixes found rewriting kiwi_codec's generator - #24
Merged
Merged
Conversation
The functions a defrustmacro defines parsed their specs without the module's type aliases, so naming one of its struct types failed. The macros now lower with the same aliases defrust does, passed with the rest of what lowering a module's macros needs as one context.
A Result or NifResult receiving a method Result lacks, as decoder.read_bool().encode(env), was lowered as is and failed to compile. It now propagates with ?, as a fallible operand does.
for item <- slice binds each item as a reference, as Rust's for loop does, so a call taking a reference no longer borrows it again.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three gaps found while moving kiwi_codec's Rustler generator onto ordinary RustQ modules (open-pencil/kiwi_codec#8).
defrustmacrofunctions can name the module's types. Their specs used to be parsed without the module's type aliases, so@spec name(R.slice(variant())) :: …failed with "no Rust type". They now lower with the same aliasesdefrustuses, passed through one build context instead of five positional arguments.decoder.read_bool().encode(env)now lowers todecoder.read_bool()?.encode(env), as a fallible operand already did. This applies toResultandNifResultreceivers calling a methodResultlacks.for name <- namesover a&[String], or over a list behind a reference, bindsnameas&String, so passing it where a reference is expected no longer borrows it twice. clippy rejects that double borrow asneedless_borrow.mix cipasses. With this branch and #23, Figler'smix cipasses, clippy included, apart from the package tests, which can't build a Hex package while dependencies are local paths.